package com.castle.fortress.admin.flowable.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审批类型
 * @author  castle
 */
@Getter
@AllArgsConstructor
public enum FlowableApprovalTypeEnum {
    ASSIGN_USER(1,"ASSIGN_USER","指定人员"),
    SELF_SELECT(2,"SELF_SELECT","发起人自选"),
    LEADER_TOP(3,"LEADER_TOP","连续多级主管"),
    LEADER(4,"LEADER","指定主管"),
    ROLE(5,"ROLE","角色"),
    SELF(6,"SELF","发起人自己"),
    ASSIGN_USERS(7,"ASSIGN_USERS","指定多个人员"),
    ;

    Integer code;
    String name;
    String desc;

    public static String getNameByCode(Integer code){
        for(FlowableApprovalTypeEnum e: FlowableApprovalTypeEnum.values()){
            if(e.getCode().equals(code)){
                return e.getName();
            }
        }
        return null;
    }
}
